<template>
  <el-row type="flex" justify="end">
    <el-pagination
      layout="total, sizes, prev, pager, next, jumper"
      :total="length"
      :page-size="pageSize"
       @size-change="sizeChange"
      :page-sizes="[10, 15]"
      :current-page="currentPage"
      @update:currentPage="$emit('update:currentPage', $event)"
    >
    </el-pagination>
  </el-row>
</template>

<script>
export default {
  name: "TablePagination",
  props: {
    length: {
      type: Number,
      default: 0,
    },
    pageSize: {
      type: Number,
      default: 12,
    },
    currentPage: {
      type: Number,
      default: 1,
    },
  },
  methods:{
    sizeChange(s){
      this.$emit("update:page-size", s);
      this.$nextTick(()=>this.historyDir.forEach(dir=>this.cleanBuffer(dir)));
    },
  }
};
</script>